package com.arcsoft.commonbase.net

import com.arcsoft.commonbase.bean.AlarmSave
import com.arcsoft.commonbase.bean.BannerBean
import com.arcsoft.commonbase.bean.CardNoBean
import com.arcsoft.commonbase.bean.DeviceAlarmSetBean
import com.arcsoft.commonbase.bean.DeviceBean
import com.arcsoft.commonbase.bean.DeviceBeanContent
import com.arcsoft.commonbase.bean.DeviceFlowBean
import com.arcsoft.commonbase.bean.DeviceCheckBean
import com.arcsoft.commonbase.bean.DeviceCountBean
import com.arcsoft.commonbase.bean.DeviceDetailBean
import com.arcsoft.commonbase.bean.DeviceShareBean
import com.arcsoft.commonbase.bean.DeviceShareUserInfoBean
import com.arcsoft.commonbase.bean.DogFileBean
import com.arcsoft.commonbase.bean.DogFileBeanContent
import com.arcsoft.commonbase.bean.FenceBean
import com.arcsoft.commonbase.bean.FileUploadBean
import com.arcsoft.commonbase.bean.GroupBean
import com.arcsoft.commonbase.bean.MsgBean
import com.arcsoft.commonbase.bean.MsgCalendarBean
import com.arcsoft.commonbase.bean.MsgDetail
import com.arcsoft.commonbase.bean.MsgUnReadCountBean
import com.arcsoft.commonbase.bean.MyInfoBean
import com.arcsoft.commonbase.bean.OrderListBean
import com.arcsoft.commonbase.bean.OrderListBeanContent
import com.arcsoft.commonbase.bean.OrderListDetailBean
import com.arcsoft.commonbase.bean.PointBean
import com.arcsoft.commonbase.bean.ProvinceBean
import com.arcsoft.commonbase.bean.ServiceDetail
import com.arcsoft.commonbase.bean.ServiceListBean
import com.arcsoft.commonbase.bean.ShareUrlBean
import com.arcsoft.commonbase.bean.StatisticsCountBean
import com.arcsoft.commonbase.bean.TeamDetail
import com.arcsoft.commonbase.bean.TrackBean
import com.arcsoft.commonbase.bean.VersionBean
import com.arcsoft.commonbase.bean.WorkOrderBean
import com.arcsoft.commonbase.bean.WorkOrderBeanContent
import com.arcsoft.commonbase.bean.WorkOrderBeanDetail
import com.asd.yigongdan.ui.main.login.LoginBean
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.*

/**
 *创建人:雷富
 *创建时间:2019/6/5 17:16
 *描述:
 */
interface ApiService {

    companion object {
        const val BASE_URL = "http://test.chezhiguan.com:8686/"
//        const val BASE_URL = "http://60.176.196.159:8686/"

    }


    @GET("app/version/latest")
    suspend fun getVersion(@QueryMap map: HashMap<String, Any>): BaseResponseBean<VersionBean>

    //登录
    @POST("app/login")
    suspend fun getLogin(@Body map: HashMap<String, Any>): BaseResponseBean<LoginBean>

    @POST("app/deviceLogin")
    suspend fun deviceLogin(@Body map: HashMap<String, Any>): BaseResponseBean<LoginBean>

    @POST("app/register")
    suspend fun register(@Body map: HashMap<String, Any>): BaseResponseBean<LoginBean>

    @POST("app/device/bind/phone")
    suspend fun bindPhone(@Body map: HashMap<String, Any>): BaseResponseBean<LoginBean>

    @POST("app/findPwd")
    @FormUrlEncoded
    suspend fun findPwd(@FieldMap map: HashMap<String, Any>): BaseResponseBean<LoginBean>

    @POST("app/code/check")
    suspend fun checkCode(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @GET("app/code")
    suspend fun getCode(@QueryMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @GET("app/user/current/info")
    suspend fun getMyInfo(@QueryMap map: HashMap<String, Any>): BaseResponseBean<MyInfoBean>

    @GET("app/carousel/list")
    suspend fun getBanner(@QueryMap map: HashMap<String, Any>): BaseResponseBean<BannerBean>

    @POST("app/user/current/update")
    suspend fun updateUserInfo(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/user/updatePwd")
    suspend fun updatePwd(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/user/updatePwdByPhone")
    @FormUrlEncoded
    suspend fun updatePwdByPhone(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/device/updatePwd")
    suspend fun updateDevicePwd(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/device/updatePwdByPhone")
    @FormUrlEncoded
    suspend fun updateDevicePwdByPhone(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/user/updatePhone")
    suspend fun updatePhone(@Body map: HashMap<String, Any>): BaseResponseBean<Any>


    @POST("app/workOrder/add")
    suspend fun addWorkOrder(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/workOrder/list")
    suspend fun workOrderList(@Body map: HashMap<String, Any>): BaseResponseBean<WorkOrderBean>

    @GET("app/workOrder/detail")
    suspend fun workOrderDetail(@QueryMap map: HashMap<String, Any>): BaseResponseBean<WorkOrderBeanDetail>

    @POST("app/workOrder/submit")
    suspend fun submitWorkOrder(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    //头像上传
    @POST("file/upload")
    @Multipart
    suspend fun fileUpload(
        @PartMap map: HashMap<String, RequestBody>,
        @Part file: MultipartBody.Part
    ): BaseResponseBean<FileUploadBean>


    @POST("app/device/add")
    suspend fun addDevice(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/device/delete")
    suspend fun deleteDevice(@Body map: MutableList<String>): BaseResponseBean<Any>

    @POST("app/device/update")
    suspend fun updateDevice(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @FormUrlEncoded
    @POST("app/device/reset")
    suspend fun resetDevice(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @FormUrlEncoded
    @POST("app/device/move/top")
    suspend fun moveTop(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("/app/device/list")
    suspend fun deviceList(@Body map: HashMap<String, Any>): BaseResponseBean<DeviceBean>

    @GET("/app/device/my/list")
    suspend fun deviceListMy(@QueryMap map: HashMap<String, Any>): BaseResponseBean<DeviceBean>

    @GET("/app/monitor/list")
    suspend fun mapDeviceList(@QueryMap map: HashMap<String, Any>): BaseResponseBean<DeviceBean>


    @GET("/app/monitor/status/count")
    suspend fun mapDeviceCount(@QueryMap map: HashMap<String, Any>): BaseResponseBean<DeviceCountBean>

    @GET("/app/monitor/location")
    suspend fun mapDeviceLocation(@QueryMap map: HashMap<String, Any>): BaseResponseBean<DeviceDetailBean>

    @GET("/app/monitor/team/device/list")
    suspend fun teamDeviceList(@QueryMap map: HashMap<String, Any>): BaseResponseBean<DeviceBean>

    @GET("/app/device/detail")
    suspend fun deviceDetail(@QueryMap map: HashMap<String, Any>): BaseResponseBean<DeviceDetailBean>

    @GET("/app/device/check/info")
    suspend fun deviceCheck(@QueryMap map: HashMap<String, Any>): BaseResponseBean<DeviceCheckBean>

    @GET("/app/device/flow/record")
    suspend fun deviceFlow(@QueryMap map: HashMap<String, Any>): BaseResponseBean<DeviceFlowBean>

    @GET("/app/device/alarm/setting")
    suspend fun deviceAlarmSet(@QueryMap map: HashMap<String, Any>): BaseResponseBean<DeviceAlarmSetBean>

    @POST("/app/device/alarm/setting/save")
    suspend fun deviceAlarmSave(@Body map: AlarmSave): BaseResponseBean<Any>

    @GET("/app/device/location/record")
    suspend fun deviceLocationRecord(@QueryMap map: HashMap<String, Any>): BaseResponseBean<TrackBean>

    @GET("/app/device/location/record/statistics")
    suspend fun deviceLocationRecordStatistics(@QueryMap map: HashMap<String, Any>): BaseResponseBean<StatisticsCountBean>


    @POST("app/device/Group/add")
    suspend fun addGroup(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/device/Group/list")
    suspend fun getGroupList(@Body map: HashMap<String, Any>): BaseResponseBean<GroupBean>

    @POST("app/device/Group/update")
    suspend fun updateGroup(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/device/Group/move")
    suspend fun moveGroup(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @FormUrlEncoded
    @POST("app/device/Group/delete")
    suspend fun deleteGroup(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>


    @GET("/common/location/province")
    suspend fun province(@QueryMap map: HashMap<String, Any>): BaseResponseBean<ProvinceBean>

    @GET("/common/location/city/name")
    suspend fun city(@QueryMap map: HashMap<String, Any>): BaseResponseBean<ProvinceBean>

    @POST("app/area/add")
    suspend fun addArea(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @PUT("app/area/update")
    suspend fun updateArea(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/area/del")
    suspend fun delArea(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @GET("app/area/list")
    suspend fun areaList(@QueryMap map: HashMap<String, Any>): BaseResponseBean<FenceBean>


    @POST("app/share/add")//    新增设备共享
    suspend fun addShare(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/share/list")
    suspend fun shareList(@Body map: HashMap<String, Any>): BaseResponseBean<DeviceShareBean>

    @POST("app/share/accept")
    @FormUrlEncoded
    suspend fun shareAccept(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/share/accept/list")
    suspend fun shareAcceptList(@Body map: HashMap<String, Any>): BaseResponseBean<DeviceShareBean>

    @POST("app/share/device/list")
    suspend fun sharePersonList(@Body map: HashMap<String, Any>): BaseResponseBean<DeviceShareBean>

    @POST("/app/share/cancel")
    @FormUrlEncoded
    suspend fun shareCancel(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @GET("/app/share/recent")
    suspend fun shareRecentPersonList(@QueryMap map: HashMap<String, Any>): BaseResponseBean<DeviceShareBean>

    @GET("/app/share/user/info")
    suspend fun shareUserInfo(@QueryMap map: HashMap<String, Any>): BaseResponseBean<DeviceShareUserInfoBean>


    //消息
    @GET("/app/notice/list")
    suspend fun msgList(@QueryMap map: HashMap<String, Any>): BaseResponseBean<MsgBean>

    @GET("/app/notice/device/list")
    suspend fun msgDeviceList(@QueryMap map: HashMap<String, Any>): BaseResponseBean<MsgBean>

    @GET("/app/notice/detail")
    suspend fun msgDetail(@QueryMap map: HashMap<String, Any>): BaseResponseBean<MsgDetail>

    @POST("app/notice/del")
    suspend fun deleteMsg(@Body map: MutableList<String>): BaseResponseBean<Any>

    @GET("/app/notice/calendar")
    suspend fun msgCalendar(@QueryMap map: HashMap<String, Any>): BaseResponseBean<MsgCalendarBean>

    @POST("/app/notice/read/all")
    @FormUrlEncoded
    suspend fun msgReadAll(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("/app/notice/read")
    suspend fun msgRead(@Body map: MutableList<String>): BaseResponseBean<Any>

    @GET("/app/notice/unread/count")
    suspend fun msgUnreadCount(@QueryMap map: HashMap<String, Any>): BaseResponseBean<MsgUnReadCountBean>


    @POST("/app/pay/pay")
    suspend fun pay(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("/app/service/order/list")
    @FormUrlEncoded
    suspend fun myOrderList(@FieldMap map: HashMap<String, Any>): BaseResponseBean<OrderListBean>

    @GET("/app/service/order/detail")
    suspend fun myOrderDetail(@QueryMap map: HashMap<String, Any>): BaseResponseBean<OrderListDetailBean>


    @POST("/app/service/order/add")
    suspend fun serviceAdd(@Body map: HashMap<String, Any>): BaseResponseBean<ShareUrlBean>

    @POST("/app/service/commodity/list")
    suspend fun serviceList(@Body map: HashMap<String, Any>): BaseResponseBean<ServiceListBean>

    @POST("/app/service/commodity/detail")
    @FormUrlEncoded
    suspend fun serviceDetail(@FieldMap map: HashMap<String, Any>): BaseResponseBean<ServiceDetail>

    @GET("/app/service/commodity/recharge")
    suspend fun serviceRechargeDetail(@QueryMap map: HashMap<String, Any>): BaseResponseBean<ServiceDetail>


    @GET("/app/team/session/detail")
    suspend fun getTeamDetailByCode(@QueryMap map: HashMap<String, Any>): BaseResponseBean<BaseContentBean<TeamDetail>>

    @GET("/app/team/detail")
    suspend fun getTeamDetail(@QueryMap map: HashMap<String, Any>): BaseResponseBean<BaseContentBean<TeamDetail>>

    @GET("/app/team/invitation/detail")
    suspend fun getTeamShareMsgDetail(@QueryMap map: HashMap<String, Any>): BaseResponseBean<BaseContentBean<TeamDetail>>

    @GET("/app/share/detail")
    suspend fun getMsgShareTeamPerson(@QueryMap map: HashMap<String, Any>): BaseResponseBean<BaseContentBean<TeamDetail>>

    @POST("/app/team/list")
    @FormUrlEncoded
    suspend fun getTeamList(@FieldMap map: HashMap<String, Any>): BaseResponseBean<BaseContentBean<MutableList<TeamDetail>>>

    @POST("/app/share/url/generate")
    @FormUrlEncoded
    suspend fun shareUrl(@FieldMap map: HashMap<String, Any>): BaseResponseBean<ShareUrlBean>

    @POST("/app/team/add")
    suspend fun addTeam(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("/app/team/update")
    suspend fun teamUpdate(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/team/accept")
    @FormUrlEncoded
    suspend fun teamAccept(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/team/device/share")
    @FormUrlEncoded
    suspend fun teamDeviceShare(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("app/team/device/cancel")
    @FormUrlEncoded
    suspend fun teamDeviceCancel(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("/app/team/members/add")
    @FormUrlEncoded
    suspend fun getTeamAddPerson(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("/app/team/members/quit")
    @FormUrlEncoded
    suspend fun getTeamQuit(@FieldMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("/app/dog/add")
    suspend fun addDog(@Body map: HashMap<String, Any>): BaseResponseBean<Any>


    @POST("/app/dog/update")
    suspend fun updateDog(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("/app/device/first/bind/dog")
    suspend fun firstBindDog(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @GET("/app/dog/detail")
    suspend fun getDogDetail(@QueryMap map: HashMap<String, Any>): BaseResponseBean<BaseContentBean<DogFileBeanContent>>

    @POST("/app/dog/list")
    suspend fun getDogList(@Body map: HashMap<String, Any>): BaseResponseBean<DogFileBean>

    @GET("/app/area/dogs")
    suspend fun getAreaDogList(@QueryMap map: HashMap<String, Any>): BaseResponseBean<DogFileBean>

    @POST("/app/device/imei/detail")
    @FormUrlEncoded
    suspend fun getCardNo(@FieldMap map: HashMap<String, Any>): BaseResponseBean<CardNoBean>

    @POST("/app/device/bind/dog")
    suspend fun dogBind(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("/app/device/unbind/dog")
    suspend fun dogUnBind(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("/app/point/add")
    suspend fun pointAdd(@Body map: HashMap<String, Any>): BaseResponseBean<Any>

    @DELETE("app/point/delete")
    suspend fun pointDelete(@QueryMap map: HashMap<String, Any>): BaseResponseBean<Any>

    @POST("/app/point/list")
    suspend fun pointList(@Body map: HashMap<String, Any>): BaseResponseBean<BaseContentBean<MutableList<PointBean>>>


}